package Thread.TurtleRabbit;

/**
 * @author: lqh
 * @description: 乌龟
 * @program: Demo
 * @create: 2018-04-13 11:23
 **/
public class Rabbit extends Animal{
    @Override
    public void running() {
        len -= 0.5;
        System.out.println("兔子距离终点还有"+len+"米");
        if (len<=0){
            System.out.println("兔子赢了");
            calltoback.win();
        }
        try {
            if (len%2==0){
                Thread.sleep(10000);
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
